package com.heima.comment.controller.v1;

import com.heima.comment.service.ApCommentReplyService;
import com.heima.model.comment.dtos.CommentRepayDto;
import com.heima.model.comment.dtos.CommentRepayLikeDto;
import com.heima.model.comment.dtos.CommentRepaySaveDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ApCommentController
 * Description:
 * date: 2023/8/28 0028 19:34
 *
 * @author zHan
 */
@RestController
@RequestMapping("/api/v1/comment_repay")
@Api(tags = "用户评论回复相关接口")
public class ApCommentReplyController {

    @Autowired
    private ApCommentReplyService apCommentReplyService;

    /**
     * 保存评论回复
     * @param dto
     * @return
     */
    @PostMapping("/save")
    @ApiOperation("保存评论回复")
    public ResponseResult save(@RequestBody CommentRepaySaveDto dto) {
        return apCommentReplyService.save(dto);
    }

    /**
     * 查询评论回复列表
     * @param dto
     * @return
     */
    @PostMapping("/load")
    @ApiOperation("查询评论回复列表")
    public ResponseResult load(@RequestBody CommentRepayDto dto) {
        return apCommentReplyService.load(dto);
    }

    /**
     * 点赞
     * @param dto
     * @return
     */
    @PostMapping("/like")
    @ApiOperation("点赞")
    public ResponseResult like(@RequestBody CommentRepayLikeDto dto) {
        return apCommentReplyService.like(dto);
    }

}
